<template>
	<view class="ep-list-cp">
		<view class="listItem" v-for="(item,index) in list" :key="index" :data-id="item.id" @click="click" :class="index===list.length-1?'lastfood':''">
			<view class="cp-box">
				<image class="ep-img" :src="item.package_path" mode="aspectFill" ></image>
				<view class="listItem-content">
					<text class="list-title" v-text="item.package_name"></text>
					<text class="list-txt" v-text="item.package_desp"></text>
				</view>
			</view>
			
			<view class="listItem-charge">
				<view class="listItem-l">
					<text class="list-num">{{ gmrs}}</text><text v-text="item.purchase_count">人</text>
				</view>
				<view class="listItem-r">
					<view class="list-price-row">
						<view class="list-price">{{ rmb }}<text v-text="item.true_price"></text></view>
						<view class="list-delprice">{{ rmb }}<text v-text="item.package_price"></text></view>
					</view>
					<text class="list-tab">{{ xsth }}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	name: 'ep-list-cp',
	props:{
		list:Array
	},
	data() {
		return {
			rmb:'￥',
			gmrs:'购买人数：',
			xsth:'限时特惠'
			
		};
	},
	methods: {
		click(e) {
		    this.$emit('click');
			this.$router.push({
				path: '../../pages/combo/combo-detail',
				/* query: {
					id: e.currentTarget.dataset.id
					} */
				params: {
					id: e.currentTarget.dataset.id
				}
			})
		}
	}
}
</script>

<style lang="scss">
    .ep-list-cp{
	    display: flex;
	    flex-direction:column;
		flex-wrap: nowrap;
	    background: #fff;
		
    }	
    .listItem {
	    display: flex;
	    flex-direction:column;
	    flex-wrap:nowrap;
	    justify-content:space-between;
	    margin-bottom:0rpx;
		margin: 10rpx 0 24rpx 0;
		border-bottom: 1rpx solid #eeeeee;
    }
	.lastfood{
		border-bottom: none;
	}
	.cp-box{
		display: flex;
		flex-direction:row;
		flex-wrap:nowrap;
		justify-content:space-between;
	}
    .ep-img {
	    border-radius: 10rpx;
	    width:37%;
		height:164rpx;
	    margin-right:3%
	    
    }
    .listItem-content {
	    width:60%;
	    display: flex;
	    flex-direction:column;
	    flex-wrap: nowrap;
    }
    .list-title{
		font-size: 32rpx;
		line-height: 45rpx;
		height:90rpx;
		color: #333;
		font-weight: bold;
		display: flex;
		overflow: hidden;
	    text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        display: -moz-box;
        -moz-line-clamp: 2;
        -moz-box-orient: vertical;
    }
	.list-num{
		font-size: 26rpx;
		color: #656565;
	}
	.listItem-l text{
		font-size: 26rpx;
		color: #656565;
	}
	.list-txt {
		font-size: 26rpx;
		color: #656565;
		line-height: 40rpx;
		height:80rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		display: -moz-box;
		-moz-line-clamp: 2;
		-moz-box-orient: vertical;
	}
	.listItem-charge{
		display: flex;
		flex-direction:row;
		flex-wrap: nowrap;
		justify-content: space-between;
		align-items: center;
		padding:20rpx 0	25rpx 0
	}
	.listItem-l{
		width:37%;
		margin-right:3%
	}
	.listItem-r{
		width:60%;
		display: flex;
		flex-direction:row;
		justify-content: space-between;
	}
	.list-price-row{
		display: flex;
		flex-direction:row;
		align-items: center;
	}
	.list-price{
		color: #195b3f;
		font-size: 28rpx;
		margin-right: 5rpx
	}
	.list-delprice{
		color: #333333;
		font-size: 24rpx;
		text-decoration:line-through
	}
	.list-tab{
		font-size: 20rpx;
		color: #fff;
		font-weight: 500;
		border-radius: 6rpx;
		padding:4rpx 14rpx;
		background: $uni-bg-color-gradient;
	}
</style>
